package com.sky.mapper;

import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetMealDishMapper {
    /**
     * 添加套餐对应菜品
     * @param setmealDishes
     */
    void saveSetMealDish(List<SetmealDish> setmealDishes);

    /**
     * 批量删除套餐对应菜品
     * @param ids
     */
    void deleteByIds(List<Long> ids);

    /**
     * 根据id查询套餐对应菜品
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> getById(Long id);

    /**
     * 根据setmealId删除对应菜品
     * @param id
     */
    @Delete("delete from setmeal_dish where setmeal_id=#{id}")
    void deleteById(Long id);
}
